# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2023-06-05
desc: 
sample: 
"""
name = "testfan"
#print(name[-1])
#切片
# print(name[2:5])  # s。。a
# print(name[-5:-2]) #s..a
# print(name[:-1]) #a。。。n
# print(name[0:-1:1])

#默认步长 +1 从左到右 （->） 升序
#-1 从右到左 (<-)  #降序
#print(name[-2:-5:-1]) #a...s  #aft

print(name[-5:-1:1])
print("---------111")
print(name[-1:-5:1])
print("---------222")
print(name[-1:-5:-1])
print("---------333")
print(name[::-1])
print("---------444")
print(name[:-1])
print("---------555")
print(name[-1])
print("---------666")
print(name[::])
# print(name[::-1])

for i in range(10):
    print(i,end="_")

# for i in range(10,0,-1):
#     print(i)


data_list = ['极光', 'zhangsan', '李四', 'mtx', '王五']
print(data_list[0:2])

data_tuple = tuple(data_list)
print(data_tuple[0:2])

set_list = set(data_list)
print(set_list[0:2])

info = { "k1":123, "name":"极光", "age":18 }
print(info[0])